#define _CRT_SECURE_NO_WARNINGS 1
#include"stdio.h"
#include"stdlib.h"
#include"string.h"
void rotate(int* nums, int numsSize, int k)
{
	if (k > numsSize)
		k %= numsSize;
	
	int* tmp = (int*)malloc(sizeof(int)*numsSize);
	memcpy(tmp + k, nums, sizeof(int)*(numsSize - k));
	memcpy(tmp, nums + n - k, sizeof(int) * (k));
	memcpy(nums,tmp, sizeof(int) * (numsSize));
	free(tmp);
}